//
//  Movable.h
//  DnImageCropper
//
//  Created by Ngoc on 10/11/2011.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "DnSuperImageViewEnum.h"



@protocol ResizableViewDelegate ;
@interface ResizableView : UIView{
    float borderWidth;
    ResizePosition userResizePosition;
    ResizeMethod userResizeMethod;
    float padding;
    BOOL userMoving;
    CGPoint lastPoint;
    UIImage *cornerImage, *edgeImage, *hozEdgeImage;
    CGRect selectionRect,topLeftRect,topRightRect,bottomLeftRect,bottomRightRect, middleTopRect,middleLeftRect, middleRightRect, middleBottomRect, displayRect;
    int minWidth;
    int minHeight;
    int rowCount;
    int columnCount;
    BOOL isDrawGrid;
    float gridColorAlpha;
    UILabel *label;
    Action _action;
    CGFloat _lastRotationRadian;
    CGFloat _rotation;
    UIView *_ghostView;
    BOOL _isTest;
    id<ResizableViewDelegate> _rotationDelegate;
}
@property(nonatomic, assign) float borderWidth;
@property(nonatomic, assign) int minWidth;
@property(nonatomic, assign) int minHeight;
@property(nonatomic, readonly) CGRect selectionRect;
@property(nonatomic, readonly) ResizeMethod resizeMethod;
@property(nonatomic, getter = getDisplayArea, setter = setDisplayArea:) CGRect displayArea;
@property(nonatomic, getter = getAction, setter = setAction:) Action action;
@property(nonatomic, assign) id<ResizableViewDelegate> rotationDelegate;
@property(nonatomic, assign) CGFloat rotation;
-(void) changeResizeMethod:(ResizeMethod) resizeMethod;
-(void) setDisplayArea:(CGRect)displayArea;
-(CGRect) getDisplayArea;
-(CGSize) getRatioForResizeMethod:(ResizeMethod) resizeMethod;
-(void) resetAll;
@end

@protocol ResizableViewDelegate <NSObject>

-(void) rotationChange:(CGFloat) rotation;

@end
